﻿using AnesSystem.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls
{
    /// <summary>
    /// PacuMedicineDialogCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class PacuMedicineDialogCtrl : UserControl
    {
        private static PacuMedicineDialogCtrl _instance;

        public static PacuMedicineDialogCtrl Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = new PacuMedicineDialogCtrl();
                }
                return _instance;
            }
        }

        public PacuMedicineDialogCtrl()
        {
            InitializeComponent();
            this.DataContext = PacuMedicineConfigCtrlViewModel.Instance;
        }

        private void MedicCtrlButton_Click(object sender, RoutedEventArgs e)
        {
            PacuMedicineConfigCtrlViewModel.Instance.AddMedicCtrl();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string commond = (sender as Button).Tag.ToString();
            PacuMedicineConfigCtrlViewModel.Instance.Excute(commond);
        }
    }
}
